package demo1;


class X{
    Y y=new Y();//实例化成员变量//1
    public X(){//2
        System.out.print("X");
    }
}
class Y{
    public Y(){//3
        System.out.print("Y");
    }
}
class Z extends X{
    Y y=new Y();//实例化成员变量//4
    public Z(){//5
        //super();
        System.out.print("Z");
    }
    public static void main(String[] args) {
        new Z();//先执行父类在子类
    }
}
